<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.11/vue.js"></script>
</head>

<body>
  <div id="box">
    <input type="text" id="txt" v-model="msg">
    <button id="btn" @click="add">增加一条</button>
    <ul id="lists">
      <li v-for="(item,index) in lists">
        {{ item }}
      </li>
    </ul>

  </div>
  <script>
    let vm = new Vue({
      el: "#box",
      data: {
        msg: "",
        lists: []
      },
      methods: {
        add(){
          this.lists.unshift(this.msg);
          this.msg="";
        }
      }
    })
  </script>
</body>

</html>